Page({
  request() {
    function request(url, method = "GET", data = {}) {
      return new Promise((resolve, reject) => {
        wx.request({
          url: url,
          method: method,
          data: data,
          success: (data) => {
            resolve(data);
          },
          fail: (error) => {
            reject(error);
          },
        });
      });
    }
  },
});
